package com.flightgame.services;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.flightgame.hibernate.FlightDao;

@Service
public class DBServices {
	@Autowired
	private FlightDao flightDao;
	
	public void deletePreviousFlights(int ownershipId){
		if(flightDao.getUserFlight(ownershipId) != null) flightDao.deleteFlight(ownershipId);
	}
}
